package airport.server.pojo;

/**
 * Created by Romain on 13/02/15.
 */

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "HOTEL")
public class Hotel implements Serializable {

    @ManyToMany
    @JoinTable(name = "VOL_HOTEL",
            joinColumns = {@JoinColumn(name = "ID_HOTEL")},
            inverseJoinColumns = {@JoinColumn(name = "ID_VOL")})
    Set<Vol> vols = new HashSet<Vol>(0);

    @OneToMany(mappedBy = "hotel", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    private Set<Panneau> panneau = new HashSet<Panneau>(0);

    @Id
    @GeneratedValue
    @Column(name = "ID_HOTEL")
    private Long idhotel;

    @Column(name = "NOM")
    private String nom;

    @Column(name = "ADRESSE")
    private String adresse;

    @Column(name = "STANDING")
    private int standing;

    @Column(name = "TARIF")
    private float tarif;

    public Hotel() {

    }

    public Hotel(String n, String adr, int s, float t) {
        nom = n;
        adresse = adr;
        standing = s;
        tarif = t;
    }

    public Long getIdhotel() {
        return idhotel;
    }

    public void setIdhotel(Long idhotel) {
        this.idhotel = idhotel;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public int getStanding() {
        return standing;
    }

    public void setStanding(int standing) {
        this.standing = standing;
    }

    public float getTarif() {
        return tarif;
    }

    public void setTarif(float tarif) {
        this.tarif = tarif;
    }

    public Set<Panneau> getPanneau() {
        return panneau;
    }

    public void setPanneau(Set<Panneau> panneau) {
        this.panneau = panneau;
    }
}